package team.bluepen.supermarket.constant;

import team.bluepen.supermarket.data.entity.Good;

/**
 * 定义常量
 * @author Kai
 */
public final class Constant {
    /** 服务器IP地址 */
    public static final String IP_ADDRESS = "";
    /** Hdfs 地址 */
    public static final String HADOOP_URL = "hdfs://" + IP_ADDRESS + ":9000";
    /** 记录登录信息的Session ID */
    public static final String SESSION_USER = "session_market_user";

    /**最大文件大小限制*/
    public static final long FILE_MAX_SIZE = 10485760;// 10M

    /**上传文件存储目录*/
    public static final String UPLOAD_DIRECTORY = "/market/upload";
    public static final String OUTPUT_DIRECTORY = "/market/output";
    public static final String TEMP_DIRECTORY = "/market/temp";

    public static final String SERVER_TEMP_DIRECTORY = "market_temp";
    /** 标志字符画*/
    public static final String LOGO_PAINTING = " ______                 ___  __         ___         \n" +
            "/_  __/__ ___ ___ _    / _ )/ /_ _____ / _ \\___ ___ \n" +
            " / / / -_) _ `/  ' \\  / _  / / // / -_) ___/ -_) _ \\\n" +
            "/_/  \\__/\\_,_/_/_/_/ /____/_/\\_,_/\\__/_/   \\__/_//_/\n" +
            "                                                    ";
    /** 宽版本字符画 */
    public static final String LOGO_PAINTING_WIDE = " _________  _______   ________  _____ ______           ________  ___       ___  ___  _______   ________  _______   ________      \n" +
            "|\\___   ___\\\\  ___ \\ |\\   __  \\|\\   _ \\  _   \\        |\\   __  \\|\\  \\     |\\  \\|\\  \\|\\  ___ \\ |\\   __  \\|\\  ___ \\ |\\   ___  \\    \n" +
            "\\|___ \\  \\_\\ \\   __/|\\ \\  \\|\\  \\ \\  \\\\\\__\\ \\  \\       \\ \\  \\|\\ /\\ \\  \\    \\ \\  \\\\\\  \\ \\   __/|\\ \\  \\|\\  \\ \\   __/|\\ \\  \\\\ \\  \\   \n" +
            "     \\ \\  \\ \\ \\  \\_|/_\\ \\   __  \\ \\  \\\\|__| \\  \\       \\ \\   __  \\ \\  \\    \\ \\  \\\\\\  \\ \\  \\_|/_\\ \\   ____\\ \\  \\_|/_\\ \\  \\\\ \\  \\  \n" +
            "      \\ \\  \\ \\ \\  \\_|\\ \\ \\  \\ \\  \\ \\  \\    \\ \\  \\       \\ \\  \\|\\  \\ \\  \\____\\ \\  \\\\\\  \\ \\  \\_|\\ \\ \\  \\___|\\ \\  \\_|\\ \\ \\  \\\\ \\  \\ \n" +
            "       \\ \\__\\ \\ \\_______\\ \\__\\ \\__\\ \\__\\    \\ \\__\\       \\ \\_______\\ \\_______\\ \\_______\\ \\_______\\ \\__\\    \\ \\_______\\ \\__\\\\ \\__\\\n" +
            "        \\|__|  \\|_______|\\|__|\\|__|\\|__|     \\|__|        \\|_______|\\|_______|\\|_______|\\|_______|\\|__|     \\|_______|\\|__| \\|__|\n" +
            "                                                                                                                                 \n" +
            "                                                                                                                                 ";

    /**
     * {@link team.bluepen.supermarket.data.entity.User} 对应表名、列族等
     */
    public static final class UserTable {
        private UserTable() { }

        public static final String TABLE_NAME = "market_user";

        public static final String TABLE_FAMILY = "data";

        public static final String QUALIFIER_USERNAME = "user_name";
        public static final String QUALIFIER_PASSWORD = "user_password";
        public static final String QUALIFIER_ID = "user_id";
        public static final String QUALIFIER_ROLE = "user_role";
    }
    /**
     * {@link Good} 对应表名、列族等
     */
    public final static class GoodTable {
        private GoodTable() { }

        public static final String TABLE_NAME = "market_good";

        public static final String TABLE_FAMILY_1 = "good";
        public static final String TABLE_FAMILY_2 = "data";

        // family 1
        public static final String QUALIFIER_NAME = "good_name";
        public static final String QUALIFIER_ID = "good_id";

        // family 2
        public static final String QUALIFIER_STATE = "good_state";
        public static final String QUALIFIER_AMOUNT = "good_amount";
        public static final String QUALIFIER_PRICE = "good_price";
    }

    public static final String GOOD_ROW_PARAM = "good_row";
    public static final String GOOD_ID_PARAM = "good_id";
    public static final String GOOD_NAME_PARAM = "good_name";
    public static final String GOOD_PRICE_PARAM = "good_price";
    public static final String GOOD_AMOUNT_PARAM = "good_amount";
    public static final String GOOD_STATE_PARAM = "good_status";

    private Constant() { }
}
